<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

    <div id="page-title">

        <h3>
        页面分类列表
        </h3>
        <div id="breadcrumb-right">
            <div class="float-right">
            	<a href="/page/category/add/0"" class="btn medium primary-bg">
                    <span class="button-content">
                    <i class="glyph-icon icon-cog float-left"></i>
                    添加
                    </span>
                </a>
            </div>
        </div>
    </div>
    <div id="page-content">
	    <table class="table" id="exp">
	    <thead>
	    <tr>
	        <th>ID</th>
	        <th>序号</th>
	        <th>分类名称</th>
	        <th>上级名称</th>
	        <th>创建时间</th>
	        <th></th>
	    </tr>
	    </thead>
	    <tbody>
	    <#list pager.list as category>
	    <tr>
	        <td>${category.id}</td>
	        <td>${category.sequnce}</td>
	        <td class="center">${category.name}</td>
	        <td class="center"> --</td>
	        <td>
	        	${(category.createDate?string('yyyy-MM-dd HH:mm'))!'-'}
	        </td>
	        <td class="center">
	            <div class="dropdown">
	            <a href="javascript:;" title="" class="btn medium bg-blue" data-toggle="dropdown">
	                                        <span class="button-content">
	                                            <i class="glyph-icon font-size-11 icon-cog"></i>
	                                            <i class="glyph-icon font-size-11 icon-chevron-down"></i>
	                                        </span>
	            </a>
	            <ul class="dropdown-menu float-right">
	
	                <li>
	                    <a href="/page/category/update/${category.id}" title="">
	                        <i class="glyph-icon icon-edit mrg5R"></i>
	                        修改
	                    </a>
	                </li>
	                <li>
	                    <a href="/page/category/add/${category.id}" title="">
	                        <i class="glyph-icon icon-calendar mrg5R"></i>
	                        添加子类
	                    </a>
	                </li>
	            </ul>
	        </div>
	        </td>
	    </tr>
	     <#list category.children as children>
			 <tr>
		        <td>${children.id}</td>
		        <td>${children.sequnce}</td>
		        <td class="center">${children.name}</td>
		        <td class="center">
	                ${(children.parent.name)!}
		        </td>
		        <td>
		        	${(children.createDate?string('yyyy-MM-dd HH:mm'))!'-'}
		        </td>
		        <td class="center">
		            <div class="dropdown">
		            <a href="javascript:;" title="" class="btn medium bg-blue" data-toggle="dropdown">
		                                        <span class="button-content">
		                                            <i class="glyph-icon font-size-11 icon-cog"></i>
		                                            <i class="glyph-icon font-size-11 icon-chevron-down"></i>
		                                        </span>
		            </a>
		            <ul class="dropdown-menu float-right">
		
		                <li>
		                    <a href="/page/category/update/${children.id}" title="">
		                        <i class="glyph-icon icon-edit mrg5R"></i>
		                        修改
		                    </a>
		                </li>
		            </ul>
		        </div>
		        </td>
		    </tr>
	     </#list>
	    </#list>
	    </tbody>
	    <tfoot>
	    <tr>
	        <th>ID</th>
	        <th>序号</th>
	        <th>分类名称</th>
	        <th>上级名称</th>
	        <th>创建时间</th>
	        <th></th>
	    </tr>
	    </tfoot>
	    </table>
	</div>
</div> 

</div>

<script language="javascript">
$(document).ready(function() {
	 
	$(function() {
		$("#exp").dataTable({
			sScrollY: 300,
			bJQueryUI: !0,
			bStateSave: true,
			sPaginationType: "full_numbers",
			bSort:false,
			"oLanguage":{
				"sInfoEmpty": "没有数据",
				"sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
				"sZeroRecords": "没有检索到数据",
				"oPaginate":{
					"sFirst": "首页",
					"sPrevious": "前页",
					"sNext": "后页",
					"sLast": "尾页"
				}
			},
			"bRetrieve":true,
			"aoColumnDefs": [{
				sDefaultContent: '',
				aTargets: [ '_all' ]
			}]
			
		})
	})
	$(document).on("scroll",".dataTables_scrollBody",function(){$(".dataTables_scrollBody").attr("style","height:100%;z-index:999;overflow:visible"))
	
});

</script>


